Skip to main content

dbt Cheat Sheet

Primary dbt commands

CommandUsage
dbt buildbuilds and tests all selected resources (models, seeds, tests, and snapshots)
dbt runrun all models excluding tests
dbt compilecompile all models to sql. Available under the target folder
dbt docsgenerates and serves dbt docs from the dbt project
dbt run-operationused to invoke a dbt macro from the command line
dbt seedload CSV files located in the the seeds folder into the target database
dbt showexecutes the sql query without any materilzations and displays the results in terminal
dbt snapshotexecutes snapshot jobs defined in the snapshot folder of the project
dbt sourceprofives tools for working with source data, ensuring source is fresh

Node Selection

CommnandsArguments
dbt build--select / -s ; --exclude ; --selector ; --defer ; --resource-type
dbt run--select / -s ; --exclude ; --selector ; --defer
dbt test--select / -s ; --exclude ; --selector ; --defer
dbt seed--select / -s ; --exclude ; --selector
dbt snapshot--select / -s ; --exclude ; --selector
dbt list--select / -s ; --exclude ; --selector ; --resource-type
dbt freshness--select / -s ; --exclude ; --selector
dbt docs generate--select / -s ; --exclude ; --selector